package com.lry.crawlers.comic.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lry.crawlers.comic.entity.ComicUpdate;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface ComicUpdateMapper extends BaseMapper<ComicUpdate> {
    @Update("update comic_update set deleted=1 where DATE_SUB(CURDATE(), INTERVAL (select comic_close_up_time from config) DAY) > date(update_time)")
    void updateTime();

    @Update("update comic_update set chapter_num = chapter_num+1  where comic_id=#{comicId}")
    int setComicUpdateAddNum(@Param("comicId")String comicId);
}
